package team.yidong.fenda.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import team.yidong.fenda.entity.Knowledge;

import java.util.List;

/**
 * Created by xuanlong on 2018/3/7.
 */
@Repository
public interface KnowledgeRepository extends JpaRepository<Knowledge, Integer> {
    @Query("select knowledge from Knowledge knowledge where knowledge.hospitalId=?1 and knowledge.status='use'")
    List<Knowledge> findByHospitalId(Integer hospitalId);
}
